package org.dzms.services;

import java.util.List;

import org.dzms.commons.PageHandler;
import org.dzms.commons.sqlHandler;
import org.dzms.dao.groupDAO;
import org.dzms.dao.groupDetailDAO;
import org.dzms.entity.Group;
import org.dzms.entity.GroupDetail;

public class groupService {
	private groupDAO gDao = new groupDAO();
	private groupDetailDAO gdDao = new groupDetailDAO();
	
	public PageHandler findPage(int cp, String cond) {
		PageHandler pb = new PageHandler(gDao);
		pb.setCurrentPage(cp);
		pb.setCond(cond);
		return pb.findBean();
	}
	
	//根据商品id找到对应商品信息
	public List<Group> findByGpId(int gpid) {
		return gDao.findGpById(gpid);
	}
	
	public List<GroupDetail> findByGdId(int gdid) {
		return gdDao.findByGdId(gdid);
	}
}
